/* pages/detail/detail.wxss */

.detail-container {
  height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

/* 头部导航 */
.header {
  background: #ffffff;
  border-bottom: 2rpx solid rgba(0, 0, 0, 0.05);
  padding-top: env(safe-area-inset-top);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20rpx 32rpx;
  height: 88rpx;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 8rpx;
  color: #ce1b28;
  font-size: 28rpx;
  font-weight: 500;
}

.nav-title {
  font-size: 32rpx;
  font-weight: 700;
  color: #343a40;
  flex: 1;
  text-align: center;
  margin: 0 20rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  gap: 16rpx;
}

.action-item {
  width: 56rpx;
  height: 56rpx;
  border-radius: 50%;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: all 0.3s ease;
}

.action-item:hover {
  background: rgba(206, 27, 40, 0.1);
  color: #ce1b28;
}

/* 内容区域 */
.content {
  flex: 1;
  padding: 20rpx 24rpx 0;
  box-sizing: border-box;
  width: 100%;
  height: calc(100vh - 120rpx); /* 减去底部操作栏高度 */
}

/* 通用区块样式 */
.section-header {
  display: flex;
  align-items: center;
  gap: 8rpx;
  margin-bottom: 16rpx;
  color: #ce1b28;
  font-size: 28rpx;
  font-weight: 700;
}

/* 3D模型展示区 */
.model-section {
  margin-bottom: 24rpx;
}

.model-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16rpx;
}

.model-title {
  display: flex;
  align-items: center;
  gap: 8rpx;
  color: #ce1b28;
  font-size: 28rpx;
  font-weight: 700;
}

.model-controls {
  display: flex;
  gap: 8rpx;
}

.control-item {
  width: 48rpx;
  height: 48rpx;
  border-radius: 50%;
  background: #f8f9fa;
  border: 2rpx solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: all 0.3s ease;
}

.control-item.active,
.control-item:hover {
  background: rgba(206, 27, 40, 0.1);
  border-color: #ce1b28;
  color: #ce1b28;
}

.model-container {
  position: relative;
  height: 400rpx;
  width: 100%;
  background: #ffffff;
  border-radius: 20rpx;
  box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
}

.model-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  z-index: 9999;
}

.model-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.model-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12rpx;
  color: #6c757d;
  font-size: 24rpx;
}

.model-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12rpx;
  color: #dc3545;
  font-size: 24rpx;
  text-align: center;
}

.retry-btn {
  margin-top: 12rpx;
  padding: 12rpx 24rpx;
  background: #ce1b28;
  color: #ffffff;
  border: none;
  border-radius: 8rpx;
  font-size: 22rpx;
}

.control-tips {
  position: absolute;
  bottom: 16rpx;
  left: 50%;
  transform: translateX(-50%);
  padding: 8rpx 16rpx;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  border-radius: 12rpx;
  font-size: 20rpx;
  opacity: 0.8;
}

/* 基本信息区 */
.info-section {
  margin-bottom: 24rpx;
}

.info-card {
  background: #ffffff;
  border-radius: 20rpx;
  padding: 24rpx;
  box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
}

.motor-banner {
  display: flex;
  gap: 20rpx;
  margin-bottom: 24rpx;
}

.motor-image {
  width: 120rpx;
  height: 120rpx;
  border-radius: 12rpx;
  background: #f8f9fa;
  flex-shrink: 0;
}

.motor-basic {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8rpx;
  min-width: 0; /* 防止文本溢出 */
}

.motor-name {
  font-size: 32rpx;
  font-weight: 700;
  color: #343a40;
  line-height: 1.2;
  word-break: break-all;
}

.motor-model,
.motor-brand {
  font-size: 24rpx;
  color: #6c757d;
  word-break: break-all;
}

.motor-status {
  margin-top: 6rpx;
}

.motor-description {
  border-top: 2rpx solid #f1f3f4;
  padding-top: 20rpx;
}

.desc-title {
  display: block;
  font-size: 26rpx;
  font-weight: 600;
  color: #343a40;
  margin-bottom: 8rpx;
}

.desc-content {
  font-size: 24rpx;
  color: #6c757d;
  line-height: 1.6;
  word-break: break-all;
}

/* 技术规格区 */
.specs-section {
  margin-bottom: 24rpx;
}

.specs-card {
  background: #ffffff;
  border-radius: 20rpx;
  box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.specs-tabs {
  display: flex;
  background: #f8f9fa;
  white-space: nowrap;
}

.tab-item {
  flex: 1;
  min-width: 160rpx;
  padding: 20rpx 12rpx;
  text-align: center;
  font-size: 24rpx;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.tab-item.active {
  color: #ce1b28;
  background: #ffffff;
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3rpx;
  background: linear-gradient(135deg, #ce1b28, #e07327);
}

.tab-content {
  padding: 24rpx;
}

.param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280rpx, 1fr));
  gap: 16rpx;
}

.param-item {
  padding: 16rpx;
  background: #f8f9fa;
  border-radius: 12rpx;
  border: 2rpx solid #e9ecef;
  transition: all 0.3s ease;
}

.param-item:hover {
  border-color: rgba(206, 27, 40, 0.3);
  background: rgba(206, 27, 40, 0.05);
}

.param-label {
  display: block;
  font-size: 22rpx;
  color: #6c757d;
  margin-bottom: 6rpx;
}

.param-value {
  font-size: 28rpx;
  font-weight: 700;
  color: #ce1b28;
}

.param-unit {
  font-size: 22rpx;
  font-weight: 400;
  color: #6c757d;
  margin-left: 4rpx;
}

/* 性能曲线区 */
.curve-section {
  margin-bottom: 24rpx;
}

.curve-card {
  background: #ffffff;
  border-radius: 20rpx;
  box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.curve-tabs {
  display: flex;
  background: #f8f9fa;
  white-space: nowrap;
}

.curve-tab {
  flex: 1;
  min-width: 140rpx;
  padding: 16rpx 8rpx;
  text-align: center;
  font-size: 22rpx;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.curve-tab.active {
  color: #ce1b28;
  background: #ffffff;
}

.curve-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3rpx;
  background: linear-gradient(135deg, #ce1b28, #e07327);
}

.curve-container {
  height: 320rpx;
  padding: 20rpx;
}

.curve-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 应用案例区 */
.cases-section {
  margin-bottom: 24rpx;
}

.cases-list {
  display: flex;
  flex-direction: column;
  gap: 16rpx;
}

.case-item {
  background: #ffffff;
  border-radius: 16rpx;
  padding: 20rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 16rpx;
  transition: all 0.3s ease;
}

.case-item:hover {
  transform: translateY(-2rpx);
  box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.1);
}

.case-image {
  width: 100rpx;
  height: 100rpx;
  border-radius: 8rpx;
  background: #f8f9fa;
  flex-shrink: 0;
}

.case-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6rpx;
  min-width: 0;
}

.case-title {
  font-size: 26rpx;
  font-weight: 600;
  color: #343a40;
  word-break: break-all;
}

.case-desc {
  font-size: 22rpx;
  color: #6c757d;
  line-height: 1.5;
  word-break: break-all;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6rpx;
  margin-top: 6rpx;
}

/* 技术文档区 */
.docs-section {
  margin-bottom: 24rpx;
}

.docs-list {
  display: flex;
  flex-direction: column;
  gap: 12rpx;
}

.doc-item {
  background: #ffffff;
  border-radius: 12rpx;
  padding: 20rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 16rpx;
  transition: all 0.3s ease;
}

.doc-item:hover {
  background: rgba(206, 27, 40, 0.02);
  border-color: rgba(206, 27, 40, 0.2);
}

.doc-icon {
  width: 48rpx;
  height: 48rpx;
  border-radius: 50%;
  background: rgba(206, 27, 40, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ce1b28;
  flex-shrink: 0;
}

.doc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4rpx;
  min-width: 0;
}

.doc-title {
  font-size: 26rpx;
  font-weight: 600;
  color: #343a40;
  word-break: break-all;
}

.doc-desc {
  font-size: 22rpx;
  color: #6c757d;
  word-break: break-all;
}

.doc-action {
  color: #6c757d;
  flex-shrink: 0;
}

/* 底部间距 */
.bottom-spacing {
  height: 40rpx;
}

/* 底部操作栏 */
.footer {
  background: #ffffff;
  padding: 16rpx 24rpx;
  padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
  border-top: 2rpx solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 16rpx;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0;
}

.btn {
  flex: 1;
  height: 72rpx;
  border-radius: 16rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8rpx;
  font-size: 26rpx;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #ce1b28 0%, #e07327 100%);
  color: #ffffff;
  box-shadow: 0 6rpx 20rpx rgba(206, 27, 40, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1rpx);
  box-shadow: 0 8rpx 25rpx rgba(206, 27, 40, 0.4);
}

.btn-outline {
  background: #ffffff;
  color: #ce1b28;
  border: 2rpx solid #ce1b28;
  box-shadow: 0 4rpx 12rpx rgba(206, 27, 40, 0.1);
}

.btn-outline:hover {
  background: rgba(206, 27, 40, 0.05);
  transform: translateY(-1rpx);
  box-shadow: 0 6rpx 16rpx rgba(206, 27, 40, 0.2);
}

/* 响应式设计 */
@media screen and (max-width: 600rpx) {
  .content {
    padding: 16rpx 20rpx 0;
  }
  
  .motor-banner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .motor-image {
    width: 160rpx;
    height: 160rpx;
  }
  
  .param-grid {
    grid-template-columns: 1fr;
  }
  
  .case-item {
    flex-direction: column;
  }
  
  .case-image {
    width: 100%;
    height: 200rpx;
  }
  
  .footer {
    flex-direction: column;
    gap: 12rpx;
  }
  
  .btn {
    height: 80rpx;
  }
}

/* Vant组件自定义样式 */
.van-tag {
  margin-right: 6rpx;
  margin-bottom: 6rpx;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20rpx);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-section,
.info-section,
.specs-section,
.curve-section,
.cases-section,
.docs-section {
  animation: fadeInUp 0.6s ease-out;
}